package com.zmykj.hik.hikService.Controllers;

import com.alibaba.fastjson.JSONObject;
import com.zmykj.hik.hikService.entity.HikUserInfo;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author LengChen
 * @version 1.0
 * @date 2021/5/20
 */
public class test {

    public static void main(String[] args) {
        /*String xxy = "{\"UserInfo\":{\"checkUser\":true,\"userVerifyMode\":\"faceOrFpOrCardOrPw\",\"Valid\":{\"enable\":false,\"timeType\":\"local\",\"beginTime\":\"2010-01-01T00:00:00\",\"endTime\":\"2030-12-31T23:59:59\"},\"addUser\":true,\"name\":\"孙浩\",\"deleteUser\":false,\"userType\":\"normal\",\"employeeNo\":\"12346\",\"closeDelayEnabled\":false,\"doubleLockRight\":true}}\n";
        System.out.println(test.isContainChinese(xxy));*/
        HikUserInfo hikUserInfo = new HikUserInfo();
        System.out.println(JSONObject.toJSONString(hikUserInfo));

    }

    /**
     * 判断字符串中是否包含中文
     * @param str
     * 待校验字符串
     * @return 是否为中文
     * @warn 不能校验是否为中文标点符号
     */
    public static boolean isContainChinese(String str) {
        Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
        Matcher m = p.matcher(str);
        if (m.find()) {
            return true;
        }
        return false;
    }

}
